<?php  
class ModuleSearch extends Controller {
	function fetch() { 	
		$config   =& $this->locator->get('config');
		$language =& $this->locator->get('language');
		$session  =& $this->locator->get('session');
		$url      =& $this->locator->get('url');
		$template =& $this->locator->get('template');
		
		if ($config->get('search_status')) {	
			$language->load('extension/module/search.php');
		
			$view = $this->locator->create('template');

			$view->set('tpl', $template);

    		$view->set('heading_title', $language->get('heading_title'));

    		$view->set('text_advanced', $language->get('text_advanced'));
			$view->set('text_keywords', $language->get('text_keywords'));

    		$view->set('entry_search', $language->get('entry_search'));
    		$view->set('text_rss_subscribe', $language->get('text_rss_subscribe'));

    		$view->set('button_search', $language->get('button_search'));

    		$view->set('action', $url->href('search', 'page'));

      		$view->set('search', $session->get('search.search'));

    		$view->set('advanced', $url->href('search'));

    		return $view->fetch('module/search.tpl');
		}
  	}
}
?>
